07. FSL
FSL
Question:
Start Quiz:
Solution:
INSTRUCTOR NOTE:
Here's the sample site!
Check out CSS Triggers and learn more about triggering layout.
Here's the helper function that I use instead of document.querySelectorAll
. It creates an array of DOM nodes, which I think is useful because array methods like forEach()
are pretty rad.
function getDomNodeArray(selector) {
// get the elements as a DOM collection
var elemCollection = document.querySelectorAll(selector);
// coerce the DOM collection into an array
var elemArray = Array.prototype.slice.apply(elemCollection);
return elemArray;
};
var divs = getDomNodeArray('div');
Follow us on Twitter!
@aerotwist
@cwpittman